package com.manor.main.personalcenter;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.manor.common.activity.AbsActivity;
import com.manor.common.utils.L;
import com.manor.common.utils.RouteUtil;
import com.manor.main.R;
import com.manor.main.adapter.FlashSchoolTitleAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * 淘米学堂
 * Created by twq on 2020.3.26
 */
@Route(path = RouteUtil.PC_FLASH_SCHOOL)
public class FlashSchoolActivity extends AbsActivity {

    RecyclerView rvFlashSchoolTitle;
    FlashSchoolTitleAdapter flashSchoolTitleAdapter;
    private List<String> textTitle;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_flash_school;
    }

    @Override
    protected void main() {
        super.main();
        setTitle("淘米学堂-有问题就在这里找答案");
        initDate();
        initView();
    }

    private void initDate() {
        textTitle = new ArrayList<>();
        textTitle.add("淘米介绍");
        textTitle.add("推广准则");
        textTitle.add("推广素材");
        textTitle.add("常见问题");
        textTitle.add("认证问题");
        textTitle.add("糖果问题");
        textTitle.add("帐号问题");
        textTitle.add("其它解答");
    }

    private void initView() {
        rvFlashSchoolTitle = findViewById(R.id.rv_flash_school_title);
        GridLayoutManager gridLayoutManager = new GridLayoutManager(this,4);
        rvFlashSchoolTitle.setLayoutManager(gridLayoutManager);
        flashSchoolTitleAdapter = new FlashSchoolTitleAdapter(R.layout.rv_flash_school_title_item, textTitle);
        rvFlashSchoolTitle.setAdapter(flashSchoolTitleAdapter);
        flashSchoolTitleAdapter.notifyDataSetChanged();
        L.e("textTitle--FlashSchoolActivity", textTitle.toString());
    }

}
